# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dizzy
pkgver=2.0
pkgrel=11
groups=('blackarch' 'blackarch-fuzzer' 'blackarch-networking')
pkgdesc='A Python based fuzzing framework with many features.'
arch=('any')
url='http://www.c0decafe.de/'
license=('custom:unknown')
depends=('python' 'python-pcapy' 'exrex')
makedepends=('python-setuptools')
source=("https://c0decafe.de/tools/$pkgname-$pkgver.tar.gz")
sha512sums=('687cb05f59d0c05f23c4d09e27a6f15733ae229b78f4f8d24dfc56b398a1935dadac05949337cd1748d87c6b45d3f4b52043ba1df8a517f8be932f9f606242c0')

prepare() {
  cd "$pkgname-$pkgver"

  #sed -i "s|~/.local/share/dizzy|/usr/share/dizzy|g" dizzy/config.py
}

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python dizzy_cmd "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

